﻿using System.Windows;
using System.Windows.Controls;
using MavlinkPacketViewer.PacketViewer;
using SLPropertyGrid;

namespace MavlinkDebugger.PacketViewer
{
	/// <summary>
	/// An editor for a Boolean Type
	/// </summary>
	public class BooleanValueEditor : ValueEditorBase
	{
		protected CheckBox checkBox;

		/// <summary>
		/// Constructor
		/// </summary>
		/// <param name="label"></param>
		/// <param name="property"></param>
		public BooleanValueEditor(PropertyGridLabel label, PropertyItem property)
			: base(label, property)
		{
			checkBox = new CheckBox();
            checkBox.Margin = new Thickness(2);
            checkBox.VerticalAlignment = VerticalAlignment.Center;
		    checkBox.IsEnabled = false;
            checkBox.IsChecked = (bool)property.Value;

			this.Content = checkBox;
		}
       
	}
}
